package com.bwie.controller;

import com.bwie.pojo.TbProd;
import com.bwie.service.TbProdService;
import com.bwie.utils.R;
import com.bwie.vo.PageInfoVo;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/prod/index")
public class IndexController {

    @Autowired
    TbProdService prodService;

    @PostMapping("/pordList")
    public R prodList(@RequestBody  PageInfoVo pageInfoVo){
        return prodService.pageList(pageInfoVo);
    }


    @PostMapping("getUserListByName/{Name}")
    public R getUserListByName(@PathVariable(value = "Name")String Name){
        return prodService.getUserListByName(Name);
    }

    @PostMapping("saveProd")
    public R saveProd(@RequestBody TbProd tbProd){
        return prodService.saveprod(tbProd);
    }

}
